<!doctype html>

<!--[if IEMobile 7 ]> <html <?php language_attributes(); ?>class="no-js iem7"> <![endif]-->
<!--[if lt IE 7 ]> <html <?php language_attributes(); ?> class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]>    <html <?php language_attributes(); ?> class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]>    <html <?php language_attributes(); ?> class="no-js ie8"> <![endif]-->
<!--[if (gte IE 9)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!-->
<html <?php language_attributes(); ?> class="no-js">
<!--<![endif]-->

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

<title><?php bloginfo('name'); ?> <?php wp_title('-', true, 'left'); ?>
</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<!-- icons & favicons -->
<!-- For iPhone 4 -->
<link rel="apple-touch-icon-precomposed" sizes="114x114"
	href="<?php echo get_template_directory_uri(); ?>/library/images/icons/h/apple-touch-icon.png">
<!-- For iPad 1-->
<link rel="apple-touch-icon-precomposed" sizes="72x72"
	href="<?php echo get_template_directory_uri(); ?>/library/images/icons/m/apple-touch-icon.png">
<!-- For iPhone 3G, iPod Touch and Android -->
<link rel="apple-touch-icon-precomposed"
	href="<?php echo get_template_directory_uri(); ?>/library/images/icons/l/apple-touch-icon-precomposed.png">
<!-- For Nokia -->
<link rel="shortcut icon"
	href="<?php echo get_template_directory_uri(); ?>/library/images/icons/l/apple-touch-icon.png">
<!-- For everything else -->
<link rel="shortcut icon"
	href="<?php echo get_template_directory_uri(); ?>/favicon.ico">

<!-- media-queries.js (fallback) -->
<!--[if lt IE 9]>
			<script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script>			
		<![endif]-->

<!-- html5.js -->
<!--[if lt IE 9]>
			<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
		<![endif]-->

<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>">

<link rel="stylesheet/less" type="text/css"
	href="<?php echo get_template_directory_uri(); ?>/less/bootstrap.less">
<link rel="stylesheet/less" type="text/css"
	href="<?php echo get_template_directory_uri(); ?>/less/responsive.less">

<!-- wordpress head functions -->
<?php wp_head(); ?>
<!-- end of wordpress head -->

<!-- theme options from options panel -->
<?php get_wpbs_theme_options(); ?>

<?php 

// check wp user level
get_currentuserinfo();
// store to use later
global $user_level;

// get list of post names to use in 'typeahead' plugin for search bar
if(of_get_option('search_bar', '1')) { // only do this if we're showing the search bar in the nav

	global $post;
	$tmp_post = $post;
	$get_num_posts = 40; // go back and get this many post titles
	$args = array( 'numberposts' => $get_num_posts );
	$myposts = get_posts( $args );
	$post_num = 0;

	global $typeahead_data;
	$typeahead_data = "[";

	foreach( $myposts as $post ) :	setup_postdata($post);
	$typeahead_data .= '"' . get_the_title() . '",';
	endforeach;

	$typeahead_data = substr($typeahead_data, 0, strlen($typeahead_data) - 1);

	$typeahead_data .= "]";

	$post = $tmp_post;

} // end if search bar is used

?>
</head>

<body <?php body_class(); ?>>

	<header role="banner">

		<div id="inner-header" class="clearfix">

			<!-- div class="navbar navbar-fixed-top">
					<div class="navbar-inner">
						<div class="container-fluid nav-container">
							<nav role="navigation">
								<a class="brand" id="logo" title="<?php echo get_bloginfo('description'); ?>" href="<?php echo home_url(); ?>"><?php bloginfo('name'); ?></a>
								
								<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
							        <span class="icon-bar"></span>
							        <span class="icon-bar"></span>
							        <span class="icon-bar"></span>
								</a>
								
								<div class="nav-collapse">
									<?php bones_main_nav(); // Adjust using Menus in Wordpress Admin ?>
								</div>
								
							</nav>
							
							<?php if(of_get_option('search_bar', '1')) {?>
							<form class="navbar-search pull-right" role="search" method="get" id="searchform" action="<?php echo home_url( '/' ); ?>">
								<input name="s" id="s" type="text" class="search-query" autocomplete="off" placeholder="<?php _e('Search','bonestheme'); ?>" data-provide="typeahead" data-items="4" data-source='<?php echo $typeahead_data; ?>'>
							</form>
							<?php } ?>
							
						</div>
					</div-->
			<?php $pagename = get_query_var('pagename');
				if ( !$pagename && $id > 0 ) {
					// If a static page is set as the front page, $pagename will not be set. Retrieve it from the queried object
					$post = $wp_query->get_queried_object();
					$pagename = $post->post_name;
					
				} ?>
			<div class="row-fluid" style="max-width: 970px;margin: 0 auto; padding-left: 20px; padding-right: 20px;">
				<!-- div class="span3">

					<img
						src="<?php bloginfo('url'); ?>/wp-content/themes/wordpress-bootstrap/images/logo.png">

				</div-->
				
				<div class="span12">
					<!-- 	
					<div id="button" align="center" class="div_bottoni">
					
					
			
						<div style="min-height: 145px; padding-top: 93px;">
							<a href="<?php bloginfo('url');?>/" class="<?php if($pagename=="index"){echo "button active";}else{echo "button";}?>">Home</a> <a
								href="<?php bloginfo('url'); ?>/chi_siamo/" class="<?php if($pagename=="chi_siamo"){echo "button active";}else{echo "button";}?>">Chi
								Siamo</a> <a href="<?php bloginfo('url'); ?>/donazione/"
								class="<?php if($pagename=="donazione"){echo "button active";}else{echo "button";}?>">La Donazione</a> <a
								href="<?php bloginfo('url'); ?>/news/" class="<?php if($pagename=="news"){echo "button active";}else{echo "button";}?>">News & Eventi</a> <a
								href="<?php bloginfo('url'); ?>/contacts/" class="<?php if($pagename=="contacts"){echo "button active";}else{echo "button";}?>">Contatti</a>
						
						</div>
					
					</div>
 -->	
 				
 
				</div>
				
			</div>
		</div>



	</header>
	<!-- end header -->


	<div class="container">
	<?php wp_nav_menu( array( 'theme_location' => 'primary-menu', 'menu_class' => 'primary', 'fallback_cb' => '') ); ?>